<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="../assets/js/vue.js"></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/vue.resource/1.0.3/vue-resource.min.js"></script>
    <link rel="stylesheet" href="../assets/css/index.css"/>
</head>
<body>
<h1>vue-resource</h1>
<hr>
<div id="app">
    {{message}}
</div>

<script>
    var vm = new Vue({
        el: '#app',
        data: {
            message: 'hello Vue'
        },
        beforeMount:function () {
            console.log('3-beforeMount 挂在之前')

            var fromData=new FormData();
            formData.append('a','1')

            this.$http.post('/example/1.php',fromData).then((response)=>{
                console.log(response.body)
                this.message=response.body
            },(response)=>{
                console.log('error')
            })
        }
    })
</script>
</body>
</html>